import QtQuick 2.4
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle {
    id: win
    visible: true
    property string windowBgColor: "white"

    width: 300
    height:300
    x:100
    y:100

    MouseArea {
        anchors.fill: parent

        onWheel: {
            if (wheel.angleDelta.y > 0) {
                rect.width += 5;
                rect.x -= 2

                rect.height += 5;
                rect.y -= 2
            }
            else {
                rect.width -= 5;
                rect.x += 2

                rect.height -= 5;
                rect.y += 2
            }
        }
    }

    // 这里对ImageItem 页面进行改写
    ImageItem {
        id: rect
        width: 100
        height:100
        color: "blue"
        onTestClicked: {	//响应signal testClicked(color colParam);信号
            console.log("emit parameter:", colParam);
            console.log("receive emit parameter");
            rect.color = colParam;	//运用时，直接用形参名即可
        }
    }
}
